<?php
session_start();
require_once(ABSPATH . 'wp-admin/includes/user.php');
require_once(ABSPATH . WPINC . '/registration.php');
require_once dirname( __FILE__ ) . '/functions-clientuser.php';
require_once dirname( __FILE__ ) . '/form-process.php';
?>
<!-- hearder -->
<?php get_header(); ?>

<div id="content">
	<div class="left">
	
		<h2><img style="padding:3px; border:1px #dbdbdb solid; margin-right:10px;" src="images/user-img1.jpg" alt=""/>Your Profile</h2>
        
        <div class="info">
        	<p>Try to be as detailed as possible in formuling your question and describing it. <br />Choosing tags carefully will also help you in getting the right answers as soon as posible.</p>
        </div>
        
        <div class="question-form">
        	<div class="hl">
        		<h4>Your Profile</h4>
			<form action="" method="post" name="editprofile" id="editprofile"  enctype="multipart/form-data" >
				
				<input name="action" type="hidden" id="action" value="editprofile" />
				
        		<div class="btn-group">
        			<span class="yut-btn-secondary">
        				<input type="submit" name="editprofile"  value = "submit" >
        			</span>

					<span class="yut-btn-secondary" style="background-color:#2C5C85;">
        				<a class="smac" style="color:#C2F2FF;" onclick="submit()">Save</a>
        			</span>
        			
        			<span class="yut-btn-secondary">
        				<a class="smac" >Reset</a>
        			</span>
        		</div>
        	</div>
        	<?php 	
				
        	if($user_ID == 0)
					$user_ID = $_SESSION['user_id_yer'];				
					
					$profileuser = get_user_to_edit($user_ID);
					$user_avata = get_user_meta($user_ID,'avatar',true );
			?>
			
        	<table cellspacing="0" width="100%" class="edit">
        		<tbody>
        			<tr>
        				<td style="width:20%;background-color:#E7EEF4; border-bottom:1px solid #D0D0D0;">User Name</td>
        				<td style="width:73.5%; border-bottom:1px solid #D0D0D0;"><?=$profileuser->nickname ?></td>
        			</tr>
        			
        			<tr>
        				<td style="width:20%;background-color:#E7EEF4; border-bottom:1px solid #D0D0D0;">First Name</td>
        				<td style="width:73.5%; border-bottom:1px solid #D0D0D0;">
        					<div class="text-publish2" style="margin-bottom:0;">
								<input class="input" type="text" name="first_name" value="<?=$profileuser->first_name ?>" size="35" />
				        	</div>
        				</td>
        			</tr>
        			
        			<tr>
        				<td style="width:20%;background-color:#E7EEF4; border-bottom:1px solid #D0D0D0;">Last Name</td>
        				<td style="width:73.5%; border-bottom:1px solid #D0D0D0;">
							<div class="text-publish2" style="margin-bottom:0;">
								<input class="input" type="text" name="last_name" value="<?=$profileuser->last_name ?>" size="35" />
				        	</div>
						</td>
        			</tr>
        			
        			<tr>
        				<td style="width:20%;background-color:#E7EEF4; border-bottom:1px solid #D0D0D0;">Your Email</td>
        				<td style="width:73.5%; border-bottom:1px solid #D0D0D0;">
							<div class="text-publish2" style="margin-bottom:0;">
								<input class="input" type="text" name="user_email" value="<?=$profileuser->user_email ?>" size="35" />
				        	</div>
						</td>
        			</tr>
        			
        			<tr>
        				<td style="width:20%;background-color:#E7EEF4; border-bottom:1px solid #D0D0D0;">Your Password</td>
        				<td style="width:73.5%; border-bottom:1px solid #D0D0D0;">
							<div class="text-publish2" style="margin-bottom:0;">
								<input class="input" type="password" name="pass" value="<?=$profileuser->user_pass ?>" size="35" />
				        	</div>
						</td>
        			</tr>
        			
        			<tr>
        				<td vertical-align:0; style="width:20%; background-color:#E7EEF4; border-bottom:1px solid #D0D0D0;">Your Avatar</td>
        				<td style="width:73.5%; border-bottom:1px solid #D0D0D0;"><img style="float:left; padding:3px; border:1px #dbdbdb solid; margin-right:10px;" src="wp-content/uploads/<?php echo $user_avata; ?>" width="58px" height="59" /><input type="file" name="avatar" id="avatar" class="input" size="35"/></td>
        			</tr>
					
        		</tbody>
        	</table>
        	</form>
        </div>
    </div>  
    <!-- sidebar -->
	<?php get_sidebar(); ?>
</div>

<!-- footer -->	    
<?php get_footer(); ?>	
